/* -*- mode: c++ -*-
** control.h
** 
** Made by Kjetil Svarstad
** 
*/

#ifndef   	CONTROL_H_
# define   	CONTROL_H_

#include <systemc.h>

#include "simple_bus.h"
#include "button.h"
#include "if.h"
struct controlPacket
{
  int size;
  int id;
  int flag;
  int pushed;
};
//  Our beloved control class (changes required)
class Control : public sc_module,
								public controlIf
{
public:
  sc_port<simple_bus> busp;
  Control (sc_module_name);
	virtual void buttonPushed(int);
	virtual void main();
private:
  static int X[9];
  int arrayPos;
  controlPacket dataPacket;
  simple_bus_status status;
  
  int control_priority;
  void check(int address);
  void switchLight(int address);
};


#endif 	    /* !CONTROL_H_ */
